include ../Makehead

LdFlags += -r
CFlags += -finline-functions -I../include
CPP += -I../include

.c.s:
	$(CC) $(CFlags) -S -o $*.s $<
.s.o:
	$(AS) -o $*.o $<
.c.o:
	$(CC) $(CFlags) -c -o $*.o $<

OBJS = sched.o vsprintf.o printk.o asm.o traps.o system_call.o mktime.o  signal.o  fork.o  \
	exit.o  sys.o 

build: kernel.o 

kernel.o: $(OBJS)
	$(LD) $(LdFlags) -o $@ $(OBJS)
	sync

asm.s: asm.S 
	$(CPP) -o $@ $<

system_call.s: system_call.S
	$(CPP) -o $@ $<

clean:
	rm -rf *.o *.s 